package com.woniu.service.command;

import com.woniu.inlet.web.fo.CouponFo;
import com.woniu.utils.ApplicationContextHolder;
import lombok.Data;

@Data
public class AddCouponCommand {
    private CouponFo couponFo;
    private AddCouponCommandHandle handle;

    public AddCouponCommand() {
        this.handle = ApplicationContextHolder.getApplicationContext().getBean(AddCouponCommandHandle.class);
    }

    public AddCouponCommand(CouponFo couponFo) {
        this();
        this.couponFo = couponFo;
    }

    public void excute() {
        handle.addCoupon(this);
    }
}
